home *** CD-ROM | disk | FTP | other *** search
/ VRML Browsing & Building Cyberspace / VRML - Browsing and Building Cyberspace.iso / examples / tenth.wrl < prev    next >
Text File  |  1995-06-13  |  2KB  |  84 lines

  1. #VRML V1.0 ascii
  2.  
  3. # Example ten - create a portal from the Earth to another VRML world
  4.  
  5. # Here comes the Sun
  6. # The Separator node groups everything within it together
  7. Separator {
  8.  
  9.     # The material will effect all subsequent nodes
  10.     # The sun is yellow, isn't it?  Additive color means red + green = yellow
  11.     # We're switching to emissive color because the Sun gives off light.
  12.     Material {
  13.         emissiveColor 1 1 0        # The Sun emits lots of yellow light
  14.     }
  15.  
  16.     # The WWWAnchor node is a group node
  17.     # This means that all objects within it are linked with the anchor's URL
  18.     # We want to link the Sun, so the Sun's Sphere node goes inside of it.
  19.     # Using the description field, we provide context for the user
  20.     WWWAnchor {
  21.         name "http://www.w3.org/" # The root URL of the World Wide Web
  22.         description "A link from the Sun to W3.ORG" # Decriptive text
  23.  
  24.         # Inside the anchor, because WWWAnchor is a group node
  25.         Sphere {
  26.             radius 10        # Big Sun
  27.         }
  28.     }
  29.  
  30.     # We place the Earth within it's own Separator
  31.     # To keep everything good and isolated
  32.     Separator {
  33.  
  34.         # Let's move things out of the way here
  35.         Transform {
  36.             translation 0 20 20
  37.         }
  38.  
  39.         # Color the Earth blue, and make it absorb light
  40.         # But also make it a reflective, like water
  41.         Material {
  42.             diffuseColor 0 0 1 # Big blue marble
  43.             shininess 0.9 # Water is rather shiny
  44.         }
  45.  
  46.         # The WWWAnchor node is a group node
  47.         # This means that all objects within it are linked with the anchor's URL
  48.         # We want to link the Earth, so the Earth's Sphere node goes inside of it.
  49.         # Using the description field, we provide context for the user
  50.         WWWAnchor {
  51.             name "http://hyperreal.com/~mpesce/book/examples/second.wrl" # Another world
  52.             description "A link to another world" # Decriptive text
  53.  
  54.             # Finally, create the earth
  55.             Sphere {
  56.                 radius 2    # Little Earth
  57.             }
  58.         }
  59.  
  60.         # The Moon gets its own Separator
  61.         # Because we really do keep everything separate
  62.         Separator {
  63.  
  64.             # The Moon is just outside the Earth
  65.             Transform {
  66.                 translation 4 4 0
  67.             }
  68.  
  69.             # Color the Moon grey, make it absorb light
  70.             # It's a little shiny, but not much
  71.             Material {
  72.                 diffuseColor 0.7 0.7 0.7
  73.                 shininess 0.3
  74.             }
  75.  
  76.             # And now, create the Moon
  77.             Sphere {
  78.                 radius 1    # Tiny Moon
  79.             }
  80.         }
  81.     }
  82. }
  83.  
  84.